import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xvideos/hj_utils/widget_utils.dart';

import '../widgets/tap_widget.dart';

class NoIntegralAlert extends StatelessWidget {
  final int needPrice;
  final String name;
  NoIntegralAlert(this.needPrice, this.name, {super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Material(
        color: Colors.transparent,
        child: Stack(
          alignment: Alignment.bottomCenter,
          children: [
            Container(
              width: double.infinity,
              decoration: BoxDecoration(
                  gradient: const LinearGradient(
                      colors: [Color(0xffffe8e8), Colors.white], begin: Alignment.topCenter, end: Alignment.bottomCenter),
                  borderRadius: BorderRadius.circular(18)),
              margin: const EdgeInsets.only(
                left: 16,
                right: 16,
                bottom: 20,
              ),
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  28.sizeBoxH,
                  const Text(
                    '限时兑换',
                    style: TextStyle(color: Color(0xff333333), fontSize: 24, fontWeight: FontWeight.w500),
                  ),
                  18.sizeBoxH,
                  Text(
                    '积分不足$needPrice,无法兑换$name',
                    style: const TextStyle(color: Color(0xff666666), fontSize: 16, fontWeight: FontWeight.w400),
                  ),
                  50.sizeBoxH,
                ],
              ),
            ),
            Positioned(
              bottom: 0,
              child: TapWidget(
                  Container(
                    width: 212,
                    height: 46,
                    decoration: BoxDecoration(
                      color: const Color(0xffF25477),
                      borderRadius: BorderRadius.circular(23),
                    ),
                    alignment: Alignment.center,
                    child: const Text(
                      '取消',
                      style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                    ),
                  ),
                  ontap: () => Get.back()),
            )
          ],
        ),
      ),
    );
  }
}
